package com.example.yunpicturebackend.exception;

/**
 * @author Yan.z.h
 * @version 1.0
 */


import lombok.Getter;

/**
 * 自定义异常类
 */
@Getter
public class BusinessException  extends RuntimeException{
    private final   int code;


    public BusinessException(String message, int code) {
        super(message);
        this.code = code;

    }


    public BusinessException(ErrorCode errorCode ) {
        super(errorCode.getMessages());
        this.code = errorCode.getCode();

    }
    public BusinessException(ErrorCode errorCode ,String message) {
        super(message);
        this.code = errorCode.getCode();

    }



}
